package com.gaga.crm.base.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 首页配置类
 */
@Configuration
public class IndexConfig implements WebMvcConfigurer {

    /**
     * 配置首页路径
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //指向页面
        registry.addViewController("/").setViewName("forward:/login");
        //表示这个过滤器优先级最高
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
}
